﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 剧情设计器2._0
{
    public partial class ConfirmNewCharacterDialog : Form
    {
        List<string> newcharacters;
        public ConfirmNewCharacterDialog(List<string> l1)
        {
            newcharacters = l1;
            InitializeComponent();
        }

        private void ConfirmNewCharacterDialog_Load(object sender, EventArgs e)
        {
            checkedListBox_characters.Items.Clear();
            foreach(string name in newcharacters)
            {
                checkedListBox_characters.Items.Add(name);
            }
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            List<string> result = new List<string>();
            for(int i = checkedListBox_characters.CheckedItems.Count - 1; i >= 0; i--)
            {
                result.Add(newcharacters[i]);
            }
            newcharacters = result;
            Close();
        }
    }
}
